package github.flandre.examplemod.core.init.event;

import github.flandre.examplemod.common.entity.ExampleEntity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.MobSpawnInfo;
import net.minecraftforge.common.world.MobSpawnInfoBuilder;
import net.minecraftforge.event.world.BiomeLoadingEvent;

public class EntitySpawnEvent {
    public static void BiomeLoading(BiomeLoadingEvent event)
    {
        //假设存在这个生物群系的时候
        if(event.getName() == null)
        {
            return;
        }
        MobSpawnInfoBuilder spawns = event.getSpawns();
        //仅在地狱生成
//        if(event.getCategory().equals(Biome.Category.THEEND))
//        {
//
//        }

        spawns.withSpawner(
                EntityClassification.MONSTER, //作为怪物生成
                new MobSpawnInfo.Spawners(
                        ExampleEntity.getEntityType(),
                        10,5,5)
        );
    }
}
